﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using Expenses.MvcUI.Infrastructure;

namespace Expenses.MvcUI
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");


            Route route = routes.MapRoute(
                name: "CultureRoot",
                url: "{Culture}/{controller}/{action}/{id}",
                defaults: new { culture = "", controller = "Home", action = "RedirectToPreferedCulture", id = UrlParameter.Optional });

            route.RouteHandler = new CultureRouteHandler();
        }
    }
}